package com.ikun.producer;

import com.ikun.domain.User;
import org.apache.rocketmq.spring.core.RocketMQTemplate;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import javax.annotation.Resource;

/**
 * @Classname ProducerDemo
 * @Description TODO
 * @Date 2025/3/3 21:13
 * @Created by Song zuo gang
 */
@Component
public class ProducerDemo {

    public static final String TOPIC = "rocket";
    @Autowired
    private RocketMQTemplate rocketMQTemplate;




    public void sendMessage(User user){
        rocketMQTemplate.convertAndSend(TOPIC,user);
    }



}
